﻿using System.Windows;
using SymbolicLinkManageCore;
using SymbolicLinkManageUI.Lib;

namespace SymbolicLinkManageUI.Windows
{
    /// <summary>
    /// SelectWindows.xaml 的交互逻辑
    /// </summary>
    public partial class SelectWindow : Window
    {
        public RecordData[] selectLists = [];
        public SelectWindow()
        {
            this.Owner = Application.Current.MainWindow;
            InitializeComponent();
        }
        public SelectWindow(RecordData[] recordDatas)
        {
            this.Owner = Application.Current.MainWindow;
            InitializeComponent();
            DataContext = new SelectWindowView(this, recordDatas);
            ContentRendered += SelectWindow_ContentRendered;
        }

        private void SelectWindow_ContentRendered(object? sender, System.EventArgs e)
        {
            ContentRendered -= SelectWindow_ContentRendered;
            SizeToContent = SizeToContent.Manual;
            MaxWidth = double.PositiveInfinity;
            MaxHeight = double.PositiveInfinity;
        }
    }
}
